<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h2{
            text-align: center;
        }
        table{
            margin: 0 auto;
            border-collapse: collapse;
            text-align: center;
        }
        th{
            padding: 5px 30px;
        }
        table,
        th,
        td{
            border: 1px solid #000;
        }

    </style>
</head>
<body>
    <script>
        let num1 = +prompt('请输入银行卡余额:')
        let num2 = +prompt('请输入水费:')
        let num3 = +prompt('请输入电费:')
        let num4 = +prompt('请输入网费:')
        let num5 =num1-(num2+num3+num4)
document.write(`
    <table>
        <caption> <h2>2020年12月消费支出</h2></caption>
        <tr>
            <th>银行卡余额</th>
            <th>水费</th>
            <th>电费</th>
            <th>网费</th>
            <th>银行卡余额</th>
        </tr>
        <tr>
            <td>${num1}元</td>
            <td>${num2}元</td>
            <td>${num3}元</td>
            <td>${num4}元</td>
            <td>${num5}元</td>
        </tr>
    </table>
`)
    </script>
</body>
</html>